<?php
/*
 * @Date: 2024-12-29 21:55:41
 */
declare (strict_types = 1);

namespace app\middleware;

class Auth
{
    /**
     * 处理请求
     *
     * @param \think\Request $request
     * @param \Closure       $next
     * @return Response
     */
    public function handle($request, \Closure $next)
    {
        if ($request->action(true)!="login" && $request->session('admin',"false") == 'false') {
            return redirect('/admin/login');
        }
        return $next($request);
    }
}
